package linkedlist;

public class Test {
    public static void test1(){
        MyLinkedList list = new MyLinkedList();
        list.addFirst("a");
        list.addFirst("b");
        list.addFirst("c");
        list.addFirst("d");
        System.out.println(list);
    }
    public static void test2(){
        MyLinkedList list = new MyLinkedList();
        list.addLast("a");
        list.addLast("b");
        list.addLast("c");
        list.addLast("d");
        System.out.println(list);
    }
    public static void test3(){
        MyLinkedList list = new MyLinkedList();
        list.add(0,"a");
        list.add(1,"b");
        list.add(2,"c");
        list.add(3,"d");
        list.add(1,"x");
        System.out.println(list);
    }
    public static void test4(){
        MyLinkedList list = new MyLinkedList();
        list.add(0,"a");
        list.add(1,"b");
        list.add(2,"c");
        list.add(3,"d");
        System.out.println(list.contain("b"));
        System.out.println(list.contain("x"));
        System.out.println(list.indexOf("c"));
        System.out.println(list.indexOf("x"));
    }
    public static void test5(){
        MyLinkedList list = new MyLinkedList();
        list.add(0,"a");
        list.add(1,"b");
        list.add(2,"c");
        list.add(3,"d");
        list.removeFirst();
        System.out.println(list);
        list.removeFirst();
        System.out.println(list);
        list.removeFirst();
        System.out.println(list);
        list.removeFirst();
        System.out.println(list);
    }
    public static void test6(){
        MyLinkedList list = new MyLinkedList();
        list.add(0,"a");
        list.add(1,"b");
        list.add(2,"c");
        list.add(3,"d");
        list.removeLast();
        System.out.println(list);
        list.removeLast();
        System.out.println(list);
        list.removeLast();
        System.out.println(list);
        list.removeLast();
        System.out.println(list);
    }
    public static void test7(){
        MyLinkedList list = new MyLinkedList();
        list.add(0,"a");
        list.add(1,"b");
        list.add(2,"c");
        list.add(3,"d");
        list.remove(3);
        System.out.println(list);
        list.remove(1);
        System.out.println(list);
        list.remove(0);
        System.out.println(list);
    }
    public static void test8(){
        MyLinkedList list = new MyLinkedList();
        list.add(0,"a");
        list.add(1,"b");
        list.add(2,"c");
        list.add(3,"d");
        list.remove("a");
        list.remove("d");
        list.remove("c");
        System.out.println(list);
        list.remove("b");
        System.out.println(list);
    }
    public static void main(String[] args) {
        //test1();
        //test2();
        //test3();
        //test4();
        //test5();
        //test6();
        //test7();
        //test8();
    }
}